<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title>Bookmark List</title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLinkTo(dir:'')}">Home</a></span>
            <span class="menuButton"><g:link class="create" action="createLink">New Bookmark</g:link></span>
        </div>
		
        <g:form action="list" method="post" >
        <div class="body">
            <h1>Bookmark List</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <h3>
			Tag:<g:select from="${tagList}" name='tag' value="${tag}" onchange="document.forms[0].submit()"></g:select>
			<input type="text" size="10" name="problem"/>
			<input type="button" value="Search" onclick="gogogo()"/>
			<script language="JavaScript">
				function gogogo() {
					window.open('http://problem.corp.platform.com/cgi-bin/problemEnh/detail?problem='+document.forms[0].problem.value, '_blank');
				}
			</script>
			</h3>
			
            <div class="list">
                <table>
                    <thead>
                        <tr>
                   	        <g:sortableColumn property="id" title="Id" />
                   	        <g:sortableColumn property="name" title="Name" />
                   	        <g:sortableColumn property="tag" title="Tag" />
                   	        <th>User</th>
                   	        <g:sortableColumn property="star" title="Star" />
                        </tr>
                    </thead>
                    <tbody>
                    <g:each in="${bookmarkList}" status="i" var="bookmark">
                        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                            <td><g:link action="show" id="${bookmark.id}">${bookmark.id?.encodeAsHTML()}</g:link></td>
                            <td>
								<a href="http://problem.corp.platform.com/cgi-bin/problemEnh/query?${bookmark.url?.encodeAsHTML()}&amp;order=-num" target="_blank">${bookmark.name?.encodeAsHTML()}</a>
								<!--
								&nbsp;&nbsp;
								<a href="http://problem.corp.platform.com/cgi-bin/problemEnh/query?${bookmark.url?.encodeAsHTML()}&amp;order=priority" target="_blank">[By Priority]</a>
								&nbsp;&nbsp;
								<a href="http://problem.corp.platform.com/cgi-bin/problemEnh/query?${bookmark.url?.encodeAsHTML()}&amp;order=state" target="_blank">[By State]</a>
								&nbsp;&nbsp;
								<a href="http://problem.corp.platform.com/cgi-bin/problemEnh/query?${bookmark.url?.encodeAsHTML()}&amp;order=feature" target="_blank">[By Feature]</a>
								&nbsp;&nbsp;
								-->
								<g:link action="openLink" id="${bookmark.id}" target="_blank">&nbsp;&nbsp;[Try-Try]</g:link>
							</td>
                            <td>${bookmark.tag?.encodeAsHTML()}</td>
                            <td>${bookmark.user.username?.encodeAsHTML()}</td>
                            <td>${bookmark.star?.encodeAsHTML()}</td>
							
                        </tr>
                    </g:each>
                    </tbody>
                </table>
            </div>
            <div class="paginateButtons">
                <g:paginate total="${count}" />
            </div>
        </div>
        </g:form>
    </body>
</html>
